<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>数据统计的触发按钮页面</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="../../css/public.css" media="all" />
</head>
<body class="childrenBody">

<button data-method="setTop" class="layui-btn">数据统计</button>

<script type="text/javascript" src="../../layui/layui.js"></script>
<script>
    layui.use(['jquery','layer'],function($,layer) {

        $('.layui-btn').on('click', function () {
            var othis = $(this), method = othis.data('method');
            active[method] ? active[method].call(this, othis) : '';
        });

        //触发事件
		var index2 = null;
        var active = {
            setTop: function () {
                index2 = layer.open({
                    type: 2 //此处以iframe举例
                    , title: '<span style="font-size: 18px">A栋教学楼 教室A001</span>'
                    , content: '/page/device/deviceMsg.html'
                });
                layer.full(index2);
            }
        };
        $(window).resize(function () {
            layer.full(index2);
        });
    })
</script>

</body>
</html>